package com.liwenfeng.diancanspringboot.mapper;

import com.github.pagehelper.Page;
import com.liwenfeng.diancanspringboot.pojo.dto.TurnoverPageDTO;
import com.liwenfeng.diancanspringboot.pojo.entity.Statement;
import com.liwenfeng.diancanspringboot.pojo.entity.Turnover;
import com.liwenfeng.diancanspringboot.pojo.vo.TurnoverVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TurnoverMapper {
    @Select("select * from turnover where place = #{place} and status < 2")
    List<Turnover> getTurnovers(Integer place);

    void insert(Turnover turnover);

    @Select("select * from turnover where id = #{turnoverId}")
    Turnover getById(Long turnoverId);

    @Select("select * from turnover where status < 2")
    List<Turnover> getTurnoversDoing();

    void update(Turnover turnover);

    Page<TurnoverVO> selectByPage(TurnoverPageDTO turnoverPageDTO);
}
